<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:zj="http://www.zju.edu.cn" elementFormDefault="qualified">
  <xs:import namespace="http://www.zju.edu.cn" schemaLocation="ModuleItem.xsd"/>
  <xs:element name="Toolkit">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="zj:Module"/>
      </xs:sequence>
      <xs:attribute name="version" type="xs:string" default="2.0"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="Add">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="AddField" maxOccurs="unbounded"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="AddField">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="EasySearch" minOccurs="0"/>
        <xs:element ref="Display" minOccurs="0"/>
        <xs:element ref="Extension" minOccurs="0"/>
        <xs:element ref="DefaultValue" minOccurs="0"/>
      </xs:sequence>
      <xs:attribute name="FieldName" type="xs:string" use="required"/>
      <xs:attribute name="DisplayName" type="xs:string" use="required"/>
      <xs:attribute name="Hint" type="xs:string"/>
      <xs:attribute name="CodeTable" type="xs:string"/>
      <xs:attribute name="Length" type="xs:string"/>
      <xs:attribute name="DataType" use="required">
        <xs:simpleType>
          <xs:restriction base="xs:NMTOKEN">
            <xs:enumeration value="Date"/>
            <xs:enumeration value="double"/>
            <xs:enumeration value="text"/>
            <xs:enumeration value="string"/>
            <xs:enumeration value="money"/>
            <xs:enumeration value="DateTime"/>
            <xs:enumeration value="blob"/>
            <xs:enumeration value="int"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
      <xs:attribute name="Kind" use="required">
        <xs:simpleType>
          <xs:restriction base="xs:NMTOKEN">
            <xs:enumeration value="Calc"/>
            <xs:enumeration value="Virtual"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
      <xs:attribute name="IsEmpty" type="xs:boolean"/>
      <xs:attribute name="HtmlCtrl" use="required">
        <xs:simpleType>
          <xs:restriction base="xs:NMTOKEN">
            <xs:enumeration value="Detail"/>
            <xs:enumeration value="Text"/>
            <xs:enumeration value="Hidden"/>
            <xs:enumeration value="Upload"/>
            <xs:enumeration value="CheckBox"/>
            <xs:enumeration value="Combo"/>
            <xs:enumeration value="TextArea"/>
            <xs:enumeration value="Password"/>
            <xs:enumeration value="DetailUpload"/>
            <xs:enumeration value="MultiSelect"/>
            <xs:enumeration value="CheckBoxList"/>
            <xs:enumeration value="File"/>
            <xs:enumeration value="EasySearch"/>
            <xs:enumeration value="DetailHidden"/>
            <xs:enumeration value="DetailMultiSelect"/>
            <xs:enumeration value="Radio"/>
            <xs:enumeration value="HTML"/>
            <xs:enumeration value="DetailHTML"/>
            <xs:enumeration value="DetailTextArea"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
      <xs:attribute name="Order" type="xs:string" use="required"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="EasySearch">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="RefValue" minOccurs="0" maxOccurs="unbounded"/>
      </xs:sequence>
      <xs:attribute name="RegName" type="xs:string" use="required"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="RefValue">
    <xs:complexType>
      <xs:complexContent>
        <xs:restriction base="xs:anyType">
          <xs:attribute name="Field" type="xs:string" use="required"/>
          <xs:attribute name="RefField" type="xs:string" use="required"/>
        </xs:restriction>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
  <xs:element name="Override">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="Field" maxOccurs="unbounded"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="Field">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="Display" minOccurs="0"/>
        <xs:element ref="Extension" minOccurs="0"/>
        <xs:element ref="DefaultValue" minOccurs="0"/>
      </xs:sequence>
      <xs:attribute name="FieldName" type="xs:string" use="required"/>
      <xs:attribute name="DisplayName" type="xs:string"/>
      <xs:attribute name="Hint" type="xs:string"/>
      <xs:attribute name="CodeTable" type="xs:string"/>
      <xs:attribute name="EasySearch" type="xs:string"/>
      <xs:attribute name="IsEmpty" type="xs:boolean"/>
      <xs:attribute name="HtmlCtrl">
        <xs:simpleType>
          <xs:restriction base="xs:NMTOKEN">
            <xs:enumeration value="Detail"/>
            <xs:enumeration value="Text"/>
            <xs:enumeration value="Hidden"/>
            <xs:enumeration value="Upload"/>
            <xs:enumeration value="CheckBox"/>
            <xs:enumeration value="Combo"/>
            <xs:enumeration value="TextArea"/>
            <xs:enumeration value="Password"/>
            <xs:enumeration value="DetailUpload"/>
            <xs:enumeration value="MultiSelect"/>
            <xs:enumeration value="CheckBoxList"/>
            <xs:enumeration value="File"/>
            <xs:enumeration value="EasySearch"/>
            <xs:enumeration value="DetailHidden"/>
            <xs:enumeration value="DetailMultiSelect"/>
            <xs:enumeration value="Radio"/>
            <xs:enumeration value="HTML"/>
            <xs:enumeration value="DetailHTML"/>
            <xs:enumeration value="DetailTextArea"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
      <xs:attribute name="Order" type="xs:string"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="Display">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="Link" minOccurs="0"/>
        <xs:element ref="Attribute" minOccurs="0" maxOccurs="unbounded"/>
      </xs:sequence>
      <xs:attribute name="ThreeColumn">
        <xs:simpleType>
          <xs:restriction base="xs:NMTOKEN">
            <xs:enumeration value="three"/>
            <xs:enumeration value="one"/>
            <xs:enumeration value="two"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
      <xs:attribute name="ListRef" type="xs:boolean"/>
      <xs:attribute name="ReadOnly" type="xs:boolean"/>
      <xs:attribute name="ListWidth" type="xs:string"/>
      <xs:attribute name="Align">
        <xs:simpleType>
          <xs:restriction base="xs:NMTOKEN">
            <xs:enumeration value="center"/>
            <xs:enumeration value="left"/>
            <xs:enumeration value="right"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
      <xs:attribute name="TextHead" type="xs:boolean"/>
      <xs:attribute name="Format" type="xs:string"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="Extension">
    <xs:complexType>
      <xs:complexContent>
        <xs:restriction base="xs:anyType">
          <xs:attribute name="Search">
            <xs:simpleType>
              <xs:restriction base="xs:NMTOKEN">
                <xs:enumeration value="none"/>
                <xs:enumeration value="title"/>
              </xs:restriction>
            </xs:simpleType>
          </xs:attribute>
          <xs:attribute name="ImgClick" type="xs:string"/>
          <xs:attribute name="CheckValue" type="xs:string"/>
          <xs:attribute name="Span" type="xs:boolean"/>
          <xs:attribute name="Expression" type="xs:string"/>
        </xs:restriction>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
  <xs:element name="DefaultValue">
    <xs:complexType mixed="true">
      <xs:choice minOccurs="0" maxOccurs="unbounded"/>
      <xs:attribute name="NeedParse" type="xs:boolean"/>
      <xs:attribute name="SQLInject" type="xs:boolean"/>
      <xs:attribute name="EmptyMarco" type="xs:string"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="Link">
    <xs:complexType mixed="true">
      <xs:choice minOccurs="0"/>
      <xs:attribute name="ID" type="xs:string"/>
      <xs:attribute name="Target" type="xs:string"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="Attribute">
    <xs:complexType mixed="true">
      <xs:choice minOccurs="0" maxOccurs="unbounded"/>
      <xs:attribute name="Name" type="xs:string" use="required"/>
      <xs:attribute name="Value" type="xs:string" use="required"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="Except">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="DelField" maxOccurs="unbounded"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="DelField">
    <xs:complexType>
      <xs:complexContent>
        <xs:restriction base="xs:anyType">
          <xs:attribute name="FieldName" type="xs:string" use="required"/>
        </xs:restriction>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
</xs:schema>
